package 工具类封装.test01;

//使用封装好的工具模糊查询
import java.sql.*;
public class Test01 {
    public static void main(String[] args) {
        Connection conn = null;
        PreparedStatement ps = null;
        ResultSet rs = null;
        try {
            conn = UtilTest01.getConnection();
            ps = conn.prepareStatement("select ename from emp where ename like ?");
            ps.setString(1,"_A%");
            rs = ps.executeQuery();
            while(rs.next()){
                String s =  rs.getString(1);
                System.out.println(s);
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }finally{
            UtilTest01.close(conn,ps,rs);
        }
    }
}
